package com.example.vm.mapper;

import com.example.vm.domain.entity.VideoShare;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface VideoShareMapper {
    @Select("select * from video_share where user_id=#{userId} and video_id=#{videoId} and ip=#{ip}")
   VideoShare getByUserIdAndVideoIdAndIP(Long userId,Long videoId,String ip);
    @Insert("insert into video_share (id, ip, user_id, video_id, create_time, update_time) VALUES (#{id},#{ip},#{userId},#{videoId},#{createdTime},#{updatedTime})")
    void insert(VideoShare videoShare);
}
